package cn.powerone.scm.service.impl;

import java.util.List;
import cn.powerone.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.powerone.scm.mapper.ScmProductsSubMapper;
import cn.powerone.scm.domain.ScmProductsSub;
import cn.powerone.scm.service.IScmProductsSubService;

/**
 * 产品子表Service业务层处理
 * 
 * @author PowerOne
 * @date 2025-06-27
 */
@Service
public class ScmProductsSubServiceImpl implements IScmProductsSubService 
{
    @Autowired
    private ScmProductsSubMapper scmProductsSubMapper;

    /**
     * 查询产品子表
     * 
     * @param id 产品子表主键
     * @return 产品子表
     */
    @Override
    public ScmProductsSub selectScmProductsSubById(Long id)
    {
        return scmProductsSubMapper.selectScmProductsSubById(id);
    }

    /**
     * 查询产品子表列表
     * 
     * @param scmProductsSub 产品子表
     * @return 产品子表
     */
    @Override
    public List<ScmProductsSub> selectScmProductsSubList(ScmProductsSub scmProductsSub)
    {
        return scmProductsSubMapper.selectScmProductsSubList(scmProductsSub);
    }

    /**
     * 新增产品子表
     * 
     * @param scmProductsSub 产品子表
     * @return 结果
     */
    @Override
    public int insertScmProductsSub(ScmProductsSub scmProductsSub)
    {
        scmProductsSub.setCreateTime(DateUtils.getNowDate());
        return scmProductsSubMapper.insertScmProductsSub(scmProductsSub);
    }

    /**
     * 修改产品子表
     * 
     * @param scmProductsSub 产品子表
     * @return 结果
     */
    @Override
    public int updateScmProductsSub(ScmProductsSub scmProductsSub)
    {
        scmProductsSub.setUpdateTime(DateUtils.getNowDate());
        return scmProductsSubMapper.updateScmProductsSub(scmProductsSub);
    }

    /**
     * 批量删除产品子表
     * 
     * @param ids 需要删除的产品子表主键
     * @return 结果
     */
    @Override
    public int deleteScmProductsSubByIds(Long[] ids)
    {
        return scmProductsSubMapper.deleteScmProductsSubByIds(ids);
    }

    /**
     * 删除产品子表信息
     * 
     * @param id 产品子表主键
     * @return 结果
     */
    @Override
    public int deleteScmProductsSubById(Long id)
    {
        return scmProductsSubMapper.deleteScmProductsSubById(id);
    }
}
